<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>负边距使用技巧</title>
		<style>
			*{
				margin: 0;
				padding:0;
			}
			.wrap{
				width: 230px;
				margin: auto;
				padding: 30px;
				border: 1px dashed red;
			}
			.wrap>div{
				float:left;
				width: 100px;
				height: 100px;
				margin: 1px;
				background-color: red;
				/* 效果：左为负时,是左移，右为负时，是左拉，上下与左右类似 */
				/* margin-left: -50px;
				margin-right: -50px;
				margin-top: -50px;
				margin-bottom: -50px; */
			}
			.item{
				margin-left: -3px;
			}
			.inner{
				float:left;
				width: 25%;
				height: 300px;
				/* margin-left: 3px; */
				box-sizing: border-box;
				border-left: 3px solid #fff;
			}
			.inner:nth-child(2n+1) {
				background-color: rebeccapurple;
			}
			.inner:nth-child(2n){
				background-color: green;
			}
		</style>
	</head>
	<body>
		<!-- <div class="wrap">
			<div></div>
			<div style="background-color: green;"></div>
		</div> -->
		<div class="item">
			<div class="inner"></div>
			<div class="inner"></div>
			<div class="inner"></div>
			<div class="inner"></div>
		</div>
	</body>
</html>